package main

import (
	"errors"
	"fmt"
)

type error interface {
	Error() string
}

type Phone interface {
	call()
}

type Man struct {
}

func (man1 Man) call() {
	fmt.Println("I am man")
}

type Woman struct {
}

func (woman1 Woman) call() {
	fmt.Println("I am woman")
}

func main() {
	var phone1 Phone

	phone1 = new(Man)
	phone1.call()

	phone1 = new(Woman)
	phone1.call()

	result, err := testError(2)
	if err != nil {
		fmt.Println(result, err)
	}
}

func testError(i int) (int, error) {
	if i > 1 {
		return i, errors.New("this is error")
	}

	return i, nil
}
